package com.mall.users.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mall.model.domain.UmsMenu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author LQJdeDELL
* @description 针对表【ums_menu(后台菜单表)】的数据库操作Mapper
* @createDate 2023-03-09 22:29:16
* @Entity generator.domain.UmsMenu
*/
public interface UmsMenuMapper extends BaseMapper<UmsMenu> {


    List<UmsMenu> selectByIds(@Param("ids") List<Long> ids);

    @Select("select * from ums_menu")
    List<UmsMenu> selectAll();


    Integer selectCount(Long parentId);

    List<UmsMenu> selectByPage(@Param("parentId") Long parentId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);

    @Select("select * from ums_menu where title = #{title}")
    UmsMenu selectByTitle(String title);

    @Select("select * from ums_menu where name = #{name}")
    UmsMenu selectByName(String name);

    void save(UmsMenu umsMenu);

    @Delete("delete from ums_menu where id = #{id}")
    void deleteById(Long id);

    @Select("select * from ums_menu where id = #{id}")
    UmsMenu selectById(Long id);


    void update(UmsMenu umsMenu);

    @Update("update ums_menu set hidden = #{hidden} where id = #{id}")
    void updateHidden(Long id, Integer hidden);
}




